package org.openfans.domain;

import org.openfans.persistence.NeedPersist;
import org.openfans.persistence.Persistence;

/**
 * 描述：持久对象的超类，通过继承它获得持久的能力<br>
 * 日期：2006-5-29<br>
 * 
 * @author 张俊<br>
 * @email:pesome@gmail.com<br>
 */
public abstract class PersistentObject implements NeedPersist {
	private Persistence persistence;

	public void save() {
		persistence.save(this);

	}

	public void remove() {
		persistence.remove(this);
	}

	public void setPersistence(Persistence persistence) {
		this.persistence = persistence;
	}

	public Persistence getPersistence() {
		return persistence;
	}
}
